#include <stdio.h>

int main(int argc,char** argv)
{
  FILE* file = fopen("./1.txt","r");
  if(file == NULL)
  {
    fprintf(stderr,"./1.txt is fopen fail\n");
    return -1;
  }
  FILE* file_2 = fopen("./2.txt","w");
  if(file == NULL)
  {
    fprintf(stderr,"./2.txt is fopen fail\n");
    return -1;
  }
  char buf;
  int ret;
  while(1)
  {
    ret = fread(&buf,1,1,file);
    if(ret == 0)
    {
      break;
    }

    fwrite(&buf,1,1,file_2);
  }

  fclose(file_2);
  fclose(file);
  return 0;
}


